/*
 * @Author: 飞越疯人院 353362604@qq.com
 * @Date: 2022-09-21 08:39:23
 * @LastEditors: 飞越疯人院 353362604@qq.com
 * @LastEditTime: 2023-02-15 15:13:32
 * @FilePath: \adminstration\src\Common\Modal\ThrModalList\LabReportTemplates.jsx
 * @Description: 这是默认设置,请设置`customMade`, 打开koroFileHeader查看配置 进行设置: https://github.com/OBKoro1/koro1FileHeader/wiki/%E9%85%8D%E7%BD%AE
 */
import { API_LIST } from '../../Api/Api'
import { commonTableList } from '../config'
import { setSelectSort } from '../../Router/MenuBoxList'

export const PushFlowConfig = async ({ data, ClientData }) => {
    let dataList = {
        uuid: data.uuid,
        type: '新增人员',
        width: 800,
        classification: 'SelectModal',
        isCheckbox: true,
        pageSize: 10,
        params: { pageIndex: 1 },
        get: API_LIST()['getPushFlowUserGetNotHaveUserList'],
        pos: 'posPushFlowUser',
        assemblyData: e => {
            let list = []
            e.forEach(
                item =>
                    (list = [
                        ...list,
                        {
                            organizationUuid: item.organizationUuid,
                            pushFlowConfigUuid: data.uuid,
                            userUuid: item.userUuid,
                        },
                    ]),
            )
            return list
        },
        columns: [
            {
                title: '人员id',
                dataIndex: 'userUuid',
                search: false,
                type: 'hidden',
                hideInTable: true,
            },
            { ...commonTableList.organizationUuid, valueEnum: ClientData.organization },
            {
                title: '账户',
                dataIndex: 'tableName',
                search: false,
            },
            {
                title: '姓名',
                dataIndex: 'fullName',
            },
            {
                title: '手机号',
                dataIndex: 'mobile',
            },
        ],
    }

    return dataList
}
